﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using WebServer.Models;

namespace WebServer
{
    // 注意: 使用“重构”菜单上的“重命名”命令，可以同时更改代码和配置文件中的接口名“IBourse”。
    [ServiceContract]
    public interface IBourse
    {
        #region 交易所信息-总数/列表[字段少/可根据名称查询/字段多]/热门交易所/根据CenterID获取信息/修改/删除/交易所最大CenterID/交易所统计
        /// <summary>
        /// 交易所总数
        /// </summary>
        /// <param name="Simple"></param>
        /// <param name="IsOpen"></param>
        /// <returns></returns>
        [OperationContract]
        int BourseCounts(int IsOpen);


        /// <summary>
        /// 获取交易所列表【字段少】
        /// </summary>
        /// <param name="Page"></param>
        /// <param name="PageSize"></param>
        /// <param name="isOpen"></param>
        /// <param name="OrderID">0-创建时,1-Name,2-Tel，3-Email，4-Address，5-Img</param>
        /// <param name="Desc"></param>
        /// <returns></returns>
        [OperationContract]
        List<BourseA> BourseListA(int Page, int PageSize, bool isOpen, int Order, bool Desc);

        /// <summary>
        /// 获取交易所列表【可根据名称查询】
        /// </summary>
        /// <param name="Page"></param>
        /// <param name="PageSize"></param>       
        /// <param name="isOpen"></param>
        /// <param name="Remak">查询条件【名称】</param>
        /// <param name="OrderID">0-创建时,1-Name,2-Tel，3-Email，4-Address，5-Img</param>
        /// <returns></returns>
        [OperationContract]
        List<BourseC> BourseListB(int Page, int PageSize, int isOpen, string Remak, int Order, bool Desc);



        /// <summary>
        /// 获取交易所列表【字段多】
        /// </summary>
        /// <param name="Page"></param>
        /// <param name="PageSize"></param>       
        /// <param name="isOpen"></param>
        /// <param name="OrderID">0-创建时,1-Name,2-Tel，3-Email，4-Address，5-Img</param>
        /// <returns></returns>
        [OperationContract]
        List<BourseC> BourseListC(int Page, int PageSize, int isOpen, int Order, bool Desc);

        /// <summary>
        /// 热门交易所
        /// </summary>
        /// <param name="PageSize"></param>
        /// <param name="PageIndex"></param>
        /// <param name="Sort">默认根据回复，1-创建时间</param>
        /// <param name="Desc"></param>
        /// <returns></returns>
        [OperationContract]
        List<BourseA> BourseSort(int PageSize, int PageIndex, int Sort, bool Desc);


        /// <summary>
        /// 查询指定交易所
        /// </summary>
        /// <param name="CenterID"></param>
        /// <returns></returns>
        [OperationContract]
        BourseC BourseByCenterID(int CenterID);

        /// <summary>
        /// 修改或者添加交易所
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity BourseSet(BourseC entity);

        /// <summary>
        /// 删除交易所
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity BourseDel(int ID);

        /// <summary>
        /// 交易所最大CenterID
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        int getMaxCenterID();


        /// <summary>
        /// 交易所统计
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string BourseCount();

        #endregion


        #region 藏品信息-总数/列表[可根据名称查询]/根据CenterID，Code获取信息/获取最近N天上线的/藏品介绍/根据交易所CenterID获取藏品库存/修改/删除
        /// <summary>
        /// 藏品总数
        /// </summary>
        /// <param name="Simple"></param>
        /// <param name="IsOpen"></param>
        /// <returns></returns>
        [OperationContract]
        int GoodsCount(int CenterID, string Code, string Key, int IsOpen);


        /// <summary>
        /// 获取藏品列表【根据名称查询】
        /// </summary>
        /// <param name="Page"></param>
        /// <param name="PageSize"></param>
        /// <param name="CenterID"></param>
        /// <param name="Code"></param>
        /// <param name="Simple"></param>
        /// <param name="Key"></param>
        /// <param name="IsOpen"></param>
        /// <param name="Order">默认-修改时间,1-CenterID,2-Shortened,3-Code,4-Fullname,5-OnLinePrice,6-OnLinePrice,7-Stock,8-Circulation,9-PublishTime</param>
        /// <param name="Desc"></param>
        /// <returns></returns>
        /// <returns></returns>
        [OperationContract]
        List<Goods> GoodsListA(int Page, int PageSize, int CenterID, string Code, bool Simple, string Key, int IsOpen, int Order, bool Desc);

        /// <summary>
        /// 查询指定藏品
        /// </summary>
        /// <param name="CenterID"></param>
        /// <param name="Code"></param>
        /// <returns></returns>s
        [OperationContract]
        Goods GoodsByCode(int CenterID, string Code);

        /// <summary>
        /// 获取最近N天上线的
        /// </summary>
        /// <param name="Times"></param>
        /// <param name="Cached">更新缓存</param>
        /// <returns></returns>
        [OperationContract]
        List<Goods> GoodsListed(int Days, bool Cached);



        /// <summary>
        /// 藏品介绍
        /// </summary>
        /// <param name="CenterID"></param>
        /// <param name="Code"></param>
        /// <returns></returns>
        [OperationContract]
        string GoodsIntroduce(int CenterID, string Code);

        /// <summary>
        /// 根据交易所CenterID获取藏品库存
        /// </summary>
        /// <param name="Page"></param>
        /// <param name="PageSize"></param>
        /// <param name="CenterID"></param>
        /// <param name="Code"></param>
        /// <param name="Simple"></param>
        /// <param name="Key"></param>
        /// <param name="IsOpen"></param>
        /// <param name="Order">默认-修改时间,1-CenterID,2-Shortened,3-Code,4-Fullname,5-OnLinePrice,6-OnLinePrice,7-Stock,8-Circulation,9-PublishTime</param>
        /// <param name="Desc"></param>
        /// <returns></returns>
        [OperationContract]
        List<GoodsStock> GoodsStock(int Page, int PageSize, int CenterID, string Code, bool Simple, string Key, int IsOpen, int Order, bool Desc);

        /// <summary>
        /// 修改或者添加藏品
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity GoodsSet(Goods entity);

        /// <summary>
        /// 删除藏品
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity GoodsDel(int ID);
        #endregion



        #region App首页显示交易所-App首页显示交易所列表/ 是否显示在APP首页
        /// <summary>
        /// App首页显示交易所列表
        /// </summary>
        /// <param name="Page"></param>
        /// <param name="PageSize"></param>
        /// <param name="isOpen"></param>
        /// <param name="Remak"></param>
        /// <param name="OrderID">0-创建时,1-Name,2-Tel，3-Email，4-Address，5-Img</param>
        /// <param name="Desc"></param>
        /// <param name="Simple"></param>
        /// <returns></returns>
        [OperationContract]
        List<BourseC> BourseAPPQ(int Page, int PageSize, int isOpen, string Remak, int OrderID, bool Desc, bool Simple);

        /// <summary>
        /// 是否显示在APP首页
        /// </summary>
        /// <param name="CenterID"></param>
        /// <param name="IsShow">true-显示，false-取消显示</param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity BourseAPP(int CenterID, bool IsShow);
        #endregion


        #region PC首页显示交易所-PC首页显示交易所/修改
        /// <summary>
        ///  PC首页显示交易所
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        BoursePC BoursePCList();

        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="Fn"></param>
        /// <param name="PCValue"></param>
        /// <returns></returns>
        [OperationContract]
        MsgEntity BoursePCSet(int Fn, string PCValue);
        #endregion
    }
}
